local table_name = "event"
local old_table = IMPORT_D:get_table(table_name)
if not old_table then
    return
end

local attrib = IMPORT_D:get_table("eventattribute")
if not attrib then
    return
end

local new_table = {}
for _, tbl in pairs(old_table) do
    new_table[tbl.event] = tonumber(tbl.eventdata)
end

for _, tbl in pairs(table.copy(attrib)) do
    if type(tbl.eventWelfareWeight) == "string" then
        local eventWelfareWeight = {}
        for _, val in ipairs(string.split(tbl.eventWelfareWeight, ";")) do
            table.insert(eventWelfareWeight, tonumber(val))
        end
        tbl.eventWelfareWeight = eventWelfareWeight
    end

    if type(tbl.eventWelfare) == "string" then
        local eventWelfare = {}
        for _, val in ipairs(string.split(tbl.eventWelfare, ";")) do
            table.insert(eventWelfare, tonumber(val))
        end
        tbl.eventWelfare = eventWelfare
    end

    if type(tbl.eventWelfareNum) == "string" then
        local eventWelfareNum = {}
        for _, val in ipairs(string.split(tbl.eventWelfareNum, ";")) do
            table.insert(eventWelfareNum, tonumber(val))
        end
        tbl.eventWelfareNum = eventWelfareNum
    end

    if type(tbl.eventWelfareWeightTxt) == "string" then
        local eventWelfareWeightTxt = {}
        for _, val in ipairs(string.split(tbl.eventWelfareWeightTxt, ";")) do
            table.insert(eventWelfareWeightTxt, tonumber(val))
        end
        tbl.eventWelfareWeightTxt = eventWelfareWeightTxt
    end

    new_table[tbl.level] = tbl
end

IMPORT_D:set(table_name, new_table)
